<?php
class controller_news extends base_module
{
    protected $News;

    public function __construct()
    {
        $this->News = RpcClient::instance("News");
        parent::__construct();
    }
    public function index()
    {
        $data = $this->News->getNewsList($this->paras);
        if($data['state']==200) {
            $result = $data['data'];
            echo json_encode($result);
        }else{
            echo json_encode($this->result);
        }
        //$ret_sync = $this->News->getNewsList($_REQUEST);
        //echo json_encode($ret_sync);
    }
    public function category()
    {
        $data = $this->News->getNewsCategory($this->paras);
        if($data['state']==200) {
            $result = $data['data'];
            echo json_encode($result);
        }else{
            echo json_encode($this->result);
        }
        //echo json_encode($this->News->getNewsCategory($_REQUEST));
    }
    public function item()
    {
        $data = $this->News->getNewsItem($this->paras);
        if($data['state']==200) {
            $result = $data['data'];
            echo json_encode($result);
        }else{
            echo json_encode($this->result);
        }
    }

}